package com.briup.corejava.day22;

import com.briup.corejava.day11.pojo.Student;

/**
 * 反射中对于类的信息的获取
 */
public class Test2 {
    public static void main(String[] args) {
        Class<Student> clazz = Student.class;
        // 获取该类实现的接口名称
        Class<?>[] interfaces = clazz.getInterfaces();
        for(Class<?> c : interfaces){
            System.out.println(c.getSimpleName());
        }
        // 获取该类继承的直接父类型
        Class<? super Student> superclass = clazz.getSuperclass();
        System.out.println(superclass.getSimpleName());
        // 获得该类所属的包
        Package aPackage = clazz.getPackage();
        System.out.println(aPackage.getName());
        // 获取注解

    }

}
